#ifndef __AMF_ENCODER_H__
#define __AMF_ENCODER_H__

#include "um_basic_types.h"
#include "amf.h"

typedef struct Encoder {
	UM_U8 *local_buf;
	UM_S32 index;
	UM_S32 len;
	UM_VOID (*write)(struct Encoder * enc, UM_U8 c);
	UM_VOID (*writeStr)(struct Encoder * enc, UM_U8 *str, UM_S32 len);
	UM_U8 (*get)(struct Encoder * enc, UM_S32 index);
	UM_S32 (*getStr)(struct Encoder * enc, UM_U8 **str);
	UM_S32 (*getSize)(struct Encoder * enc);
	UM_VOID (*clear)(struct Encoder * enc);
	UM_VOID (*free)(struct Encoder * enc);
}Encoder;

Encoder* createAMFEncoder();
UM_VOID amf_write(Encoder *enc, const AMFValue *value);

#endif